#ifndef __THREADQUEUE_HH__
#define __THREADQUEUE_HH__

#include "TaskQueue.hh"
#include <thread>
#include <vector>
#include <memory>

#define QUEUE_SIZE 10

using std::vector;
using std::thread;
using std::unique_ptr;

class ThreadQueue
{
    using Task = TaskQueue::Task;
public:
    ThreadQueue(size_t thread_size, size_t capacity);
    ~ThreadQueue();

    void Add_task(Task& task);
    Task Get_task();
    void Start();
    void Stop();
    void Do_task();
private:
    size_t _thread_size;
    vector<unique_ptr<thread>> _pool;
    TaskQueue _task_queue;
    bool _is_exit;
};

#endif